 package util;

import javax.persistence.EntityManager;

import model.Aluno;
import model.Login;
import model.Usuario;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ModelAndView;

import teste.ExemploSpring;
import exception.ConexaoException;

@Configuration
@ComponentScan(basePackages={"service","dao","controller"})
public class ConfigHibernate {
	
	
	
	@Bean
	public Aluno aluno(){
		return new Aluno();
	}
	
	@Bean
	public Login login(){
		return new Login();
	}
	
	@Bean
	public ExemploSpring exemploSpring(){
		return new ExemploSpring();
	}

	@Bean
	public Usuario usuario(){
		return new Usuario();
	}
	
	@Bean
	public ModelAndView modelAndView(){
		return new ModelAndView();
	}
	@Bean
	public EntityManager entityManager() throws ConexaoException{
		return Conexao.getConnection();
	}
}
